The superclass jakarta.servlet.http.HttpServlet was not found on the Java Build Path

✒️ 2025-05-16 09:30 내용 수정


  1. 에러가 발생한 프로젝트를 Eclipse 탐색기에서 우클릭을 눌러 Properties를 선택한다.
    build error 1.png

  2. Java Build Path - Libraries에서 Modulepath를 선택한 후 Add Library를 누른다.
    build error 2.png

  3. Server Runtime을 선택한 후 Next를 누른다.
    build error 3.png

  4. Apache Tomcat v9.0을 선택하고 Finish를 누른다.
    build error 4.png

  5. Project Facets를 눌러 아래같은 화면이 안뜨면 파란 글씨를 일단 누르고, Runtimes - Apache Tomcat v9.0을 체크한 다음, 왼쪽의 Project Facet에서 Dynamic Web Module을 체크해준 뒤 Apply - Apply and Close를 누른다.
    build error 5.png

  6. Eclipse 하단의 Servers에서 서버를 더블클릭 후 Modules를 누른 뒤 Add Web Module을 눌러 추가할 프로젝트를 선택한다.
    build error 6.png

  7. 다시 실행하면 페이지가 연결됨을 확인할 수 있다.
    build error 7.png